home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9063 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: s02.pavilion.co.uk!usenet
  2. From: AJRobb@pavilion.co.uk (Andy J Robb)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: How to make this code portable?
  5. Date: Thu, 07 Mar 1996 05:12:23 GMT
  6. Organization: Pavilion Internet plc
  7. Message-ID: <4hlr68$4s@s02.pavilion.co.uk>
  8. References: <4h8k9j$78r@habs.ee.ubc.ca>
  9. NNTP-Posting-Host: poolc15.pavilion.co.uk
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. ellenh@ee.ubc.ca (Ellen Ho) wrote:
  13.  
  14. >I am writing a program that I want to compile and run on both a Sun 
  15. >Sparcstation and a PC running OS/2 Warp.  On the Sun, I compile the .c 
  16. >files with gcc.  On the PC, I am using Visual Age.
  17.  
  18. >The program acceptes a list of filenames as command line
  19. >arguments and does some processing with the list of files.
  20. >On the Sun, I specify 
  21.  
  22. >        program *.txt
  23.  
  24. >and the shell will expand the wildcard into the names of all .txt
  25. >files in the current working directory.  So with a for loop in
  26. >my C program I can go through each file and process the data.
  27.  
  28. >However, on the PC, "*.txt" is passed into my program as
  29. >command line argument as is.  This means that I may have to
  30. >put in extra operating system dependent logic to expand the wildcard
  31. >inside my program.
  32.  
  33. >Are there other ways to handle this?
  34.  
  35. -----BEGIN PGP SIGNED MESSAGE-----
  36.  
  37. Borland compilers support wildcard expansion as an option.
  38.  
  39. Alternatively, before you run the program on the Unix system, type:
  40.  
  41. set noglob
  42.  
  43. Then you will see "*.txt" under Unix too! ;)
  44.  
  45. Regards,
  46. Andy Robb.
  47.  
  48. -----BEGIN PGP SIGNATURE-----
  49. Version: 2.6.2i
  50.  
  51. iQCVAwUBMT5wGpPl4P16x9sNAQEUoQP9EWk8zjG3GvjCVHYXwXbdLopG2vILumn3
  52. azd5hNyRuepcYM9OBXbfwJQp2baIdwhVIcuYmnAgsY7mkflpyWauNdAwj/kHne5J
  53. Ovth66UO0TabLwBfqWiX2vWn/f7vsqOadLCKE+ERhFFAIuBSED3fUNd5NYjR/daZ
  54. +pCDccoj1Rk=
  55. =VQ3w
  56. -----END PGP SIGNATURE-----
  57.  
  58. -----BEGIN PGP PUBLIC KEY BLOCK-----
  59. Version: 2.6.2i
  60.  
  61. mQCNAy/MpRwAAAEEAOt6uBYqT8yv9EmqNhK8m6v+bYi8QjnGW3Bo6iU1gsMj5pa6
  62. MHgq99c8deADbE3cbJ6uZS9v5pZE3WCf6HCQjlB5iULA5RZzMdAumd/WUzuL9UT3
  63. B44D9EqqFIL79FlYb56v4oKFqFp1/J2bIpYUwnUvabGzGjdLrpPl4P16x9sNAAUR
  64. tCNBbmR5IEogUm9iYiA8QUpSb2JiQHBhdmlsaW9uLmNvLnVrPrQhQW5keSBSb2Ji
  65. IDxBSlJvYmJAcGF2aWxpb24uY28udWs+
  66. =/wVD
  67. -----END PGP PUBLIC KEY BLOCK-----
  68.  
  69.